package com.sphd.emanu.activity.commoditypvsum;

import android.content.Context;

import com.sphd.emanu.mvp.BasePresenterImpl;
import com.sphd.emanu.pojo.goods.PvSum;
import com.sphd.emanu.utils.GsonUtil;
import com.wzutils.L;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

/**
 * MVPPlugin
 * 邮箱 784787081@qq.com
 */

public class CommodityPvSumPresenter extends BasePresenterImpl<CommodityPvSumContract.View> implements CommodityPvSumContract.Presenter {

    @Override
    public void commodityPvSum(Integer id) {
        emanuService.commodityPvSum(id).enqueue(new Callback<String>() {
            @Override
            public void onResponse(Call<String> call, Response<String> response) {
                L.e(response.toString());
                    mView.setBean(GsonUtil.GsonToBean(response.body(), PvSum.class));
            }

            @Override
            public void onFailure(Call<String> call, Throwable t) {
                Error(t);
            }
        });
    }
}
